﻿using System;
using System.Collections.Generic;
using System.IO;

namespace StudentsInBinaryFile
{
    public class Program
    {
        private const string FileName = "students.txt";

        public static void Main()
        {
            //File.Delete(FileName);

            //Student student = new Student("Marin", "Atanasov", 61131);

            //using (var writer = new BinaryWriter(File.Open(FileName, FileMode.Append, FileAccess.Write)))
            //{
            //    for (int i = 0; i < 1000000; i++)
            //    {
            //        Student.AddStudentToFile(writer, new Student(student.FirstName, student.LastName, i));
            //    }
            //}

            //Student.AddStudentToFile(FileName, student);

            //Student.RemoveStudentFromFile(FileName, 5123);

            //List<Student> studentsInFile = Student.ReadAllStudentsFromFile(FileName);
            //foreach (Student s in studentsInFile)
            //{
            //    Console.WriteLine(s);
            //}
        }
    }
}
